Class DNSClientImpl

All Implemented Interfaces:
IPCObject, DNSClient, Process

public class DNSClientImpl extends ProcessImpl implements DNSClient
Information provided by the PKI file:

    \class DnsClient
    
    \brief DnsClient is the process that handles retrieving DNS lookups.
    
    \example network().getDevice("PC0").getProcess("DnsClient")
    
Author:
Auto-generated
  • Constructor Details

  • Method Details

    • addIpAddress

      public boolean addIpAddress(String hostname, IPAddress ipAddress)
      Information provided by the PKI file:
      
          \brief Adds a DNS entry with the specified hostname and IP address to the DNS table.
          
          \param hostname, the hostname of the node.
          \param ipAddress, the IP address of the node.
          
          \return bool, true if successful, otherwise false.
          
              
      Specified by:
      addIpAddress in interface DNSClient
      Parameters:
      hostname - Takes in a parameter of hostname
      ipAddress - Takes in a parameter of ipAddress
      Returns:
      boolean Returns a boolean
    • removeIpAddress

      public void removeIpAddress(String hostname)
      Information provided by the PKI file:
      
          \brief Removes the DNS entry from the table based on the hostname.
          
          \param hostname, the hostname associated with the IP address to remove.
          
              
      Specified by:
      removeIpAddress in interface DNSClient
      Parameters:
      hostname - Takes in a parameter of hostname
    • removeIp

      public void removeIp(String hostname, IPAddress ipAddress)
      Information provided by the PKI file:
      
          \brief Removes the DNS entry from the table based on the hostname and the IP address.
          
          \param hostname, the hostname of the node.
          \param ipAddress, the IP address of the node.
          
              
      Specified by:
      removeIp in interface DNSClient
      Parameters:
      hostname - Takes in a parameter of hostname
      ipAddress - Takes in a parameter of ipAddress
    • isValidName

      public boolean isValidName(String hostname)
      Information provided by the PKI file:
      
          Returns true if the hostname is a valid name (non-special characters), otherwise false.
          
          \param hostname, the hostname of interest.
          
          \return bool, true if the hostname is a valid name (non-special characters), otherwise false.
          
              
      Specified by:
      isValidName in interface DNSClient
      Parameters:
      hostname - Takes in a parameter of hostname
      Returns:
      boolean Returns a boolean
    • setServerIp

      public void setServerIp(IPAddress ipAddress)
      Information provided by the PKI file:
      
          \brief Sets the IP address of the DNS server.
          
          \param ipAddress, the DNS server IP address.
          
              
      Specified by:
      setServerIp in interface DNSClient
      Parameters:
      ipAddress - Takes in a parameter of ipAddress
    • getServerIp

      public IPAddress getServerIp()
      Information provided by the PKI file:
      
          \brief Returns the IP address of the DNS server.
          
          \return ip, the DNS server ip address.
          
              
      Specified by:
      getServerIp in interface DNSClient
      Returns:
      IPAddress Returns a IPAddress
    • getServerIpv6

      public IPV6Address getServerIpv6()
      Information provided by the PKI file:
      
          \brief Returns the IPv6 address of the DNS server.
          
          \return ipv6, the DNS server ipv6 address.
          
              
      Specified by:
      getServerIpv6 in interface DNSClient
      Returns:
      IPV6Address Returns a IPV6Address
    • setServerIpv6

      public void setServerIpv6(IPV6Address ipAddress)
      Information provided by the PKI file:
      
          \brief Sets the IPv6 address of the DNS server.
          
          \param ipAddress, the DNS server IPv6 address.
          
              
      Specified by:
      setServerIpv6 in interface DNSClient
      Parameters:
      ipAddress - Takes in a parameter of ipAddress
    • setEnabled

      public void setEnabled(boolean bEnable)
      Information provided by the PKI file:
      
          \brief Enable or disable Dns Client Process
          
          \param bEnable, true to enable, otherwise false.
          
              
      Specified by:
      setEnabled in interface DNSClient
      Parameters:
      bEnable - Takes in a parameter of bEnable
    • isEnabled

      public boolean isEnabled()
      Information provided by the PKI file:
      
          \brief Returns true if this DNS client process is enabled, otherwise false.
          
          \return bool, true if this DNS client process is enabled, otherwise false.
          
              
      Specified by:
      isEnabled in interface DNSClient
      Returns:
      boolean Returns a boolean
    • getStrToIpCount

      public int getStrToIpCount()
      Information provided by the PKI file:
      
          \brief Returns the number of DNS entries in the DNS table.
          
          \return int, the number of DNS entries in the DNS table.
          
              
      Specified by:
      getStrToIpCount in interface DNSClient
      Returns:
      int Returns a int
    • getHostAt

      public String getHostAt(int index)
      Information provided by the PKI file:
      
          \brief Returns the hostname at the specified index.
          
          \param index, the index of the hostname of interest.
          
          \return string, the hostname at the specified index.
          
              
      Specified by:
      getHostAt in interface DNSClient
      Parameters:
      index - Takes in a parameter of index
      Returns:
      String Returns a String
    • isHostNameExisted

      public boolean isHostNameExisted(String hostname)
      Information provided by the PKI file:
      
          \brief Returns true if the hostname exists in the DNS table, otherwise false.
          
          \param hostname, the hostname of interest.
          
          \return bool, true if the hostname exists in the DNS table, otherwise false.
          
              
      Specified by:
      isHostNameExisted in interface DNSClient
      Parameters:
      hostname - Takes in a parameter of hostname
      Returns:
      boolean Returns a boolean
    • isIpExisted

      public boolean isIpExisted(String hostname, IPAddress ipAddress)
      Information provided by the PKI file:
      
          \brief Returns true if the hostname and IP address DNS entry exists, otherwise false.
          
          \param hostname, the hostname to lookup.
          \param ipAddress, the IP address to lookup.
          
          \return bool, true if the hostname and IP address entry exists, otherwise false.
          
              
      Specified by:
      isIpExisted in interface DNSClient
      Parameters:
      hostname - Takes in a parameter of hostname
      ipAddress - Takes in a parameter of ipAddress
      Returns:
      boolean Returns a boolean
    • getIpOfHost

      public List<IPAddress> getIpOfHost(String hostname)
      Information provided by the PKI file:
      
          \brief Returns a list of IP addresses associated with the specified hostname.
          
          \param hostname, the hostname of interest.
          
          \return vector<ip>, the list of IP addresses associated with the specified hostname.
          
              
      Specified by:
      getIpOfHost in interface DNSClient
      Parameters:
      hostname - Takes in a parameter of hostname
      Returns:
      List<IPAddress> Returns a List<IPAddress>